package com.yf.model.ai.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yf.base.BaseEntity;
import com.yf.model.ai.enums.AiMessageRoleEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * AI 消息记录表-AiMessage
 *
 * @author: YiFei
 * @since : 2025年7月7日 16:58:45
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "AI 消息记录表")
@EqualsAndHashCode(callSuper = true)
@TableName("ai_message")
public class AiMessage extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 751878725299L;
    /**
     * 主键
     */
    @Schema(description = "主键")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 会话ID
     */
    @Schema(description = "会话ID")
    private Long conversationId;

    /**
     * 角色
     */
    @Schema(description = "角色")
    private AiMessageRoleEnum role;

    /**
     * 内容(Markdown格式)
     */
    @Schema(description = "内容(Markdown格式)")
    private String content;

    /**
     * Metadata
     */
    @Schema(description = "Metadata")
    private String metadata;

    /**
     * 发送时间
     */
    @Schema(description = "发送时间")
    private LocalDateTime sendTime;

    /**
     * 逻辑删除标识(0:未删除;1:已删除)
     */
    @Schema(description = "逻辑删除标识(0:未删除;1:已删除)")
    private Integer deleted;

}
